Skip to content

Threaded loop updates & fixes#361

Merged
elacuesta merged 12 commits intomainfrom
threaded-loop-adjustments
Jan 21, 2026
Merged

Threaded loop updates & fixes#361
elacuesta merged 12 commits intomainfrom
threaded-loop-adjustments

Conversation

@elacuesta
Copy link
Member

@elacuesta elacuesta commented Jan 20, 2026

  • Avoid unnecessary Deferred/Future conversions
  • Fix Windows tests by not stopping the threaded loop adapter
  • Run pinned dependency envs also on Windows

@elacuesta elacuesta marked this pull request as draft January 20, 2026 18:33
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 96.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.56%. Comparing base (8cb31c1) to head (267cbde).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
scrapy_playwright/_utils.py 94.59% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #361      +/-   ##
==========================================
+ Coverage   92.89%   99.56%   +6.67%     
==========================================
  Files           6        6              
  Lines         647      685      +38     
==========================================
+ Hits          601      682      +81     
+ Misses         46        3      -43     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@elacuesta elacuesta marked this pull request as ready for review January 20, 2026 20:34
@elacuesta elacuesta requested a review from Copilot January 20, 2026 20:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the threaded loop adapter implementation and enables Windows testing for previously skipped tests. The changes eliminate unnecessary Future/Deferred conversions and fix Windows compatibility issues.

Changes:

  • Refactored threaded loop adapter to avoid unnecessary conversions between Deferred and Future objects
  • Removed platform-specific test skips on Windows by properly managing the threaded loop lifecycle
  • Extended CI to run pinned dependency tests on Windows

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/tests_asyncio/test_browser.py Replaced platform.system() checks with @allow_windows decorator
tests/init.py Updated @allow_windows to use test method ID and return Future result
scrapy_playwright/handler.py Refactored to use _future_from_coro, moved signal connections after threaded loop setup, and relocated _ThreadedLoopAdapter.stop() calls
scrapy_playwright/_utils.py Added _QueueItem dataclass, implemented _future_from_coro and _handle_coro_future methods, renamed parameters for clarity
pylintrc Added too-many-lines to pylint disable list
.github/workflows/tests.yml Added Windows-specific pinned dependency test jobs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@elacuesta elacuesta changed the title Threaded loop adjustments Threaded loop updates & fixes Jan 21, 2026
@elacuesta elacuesta merged commit 8b883d2 into main Jan 21, 2026
23 of 24 checks passed
@elacuesta elacuesta deleted the threaded-loop-adjustments branch January 21, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants